Skip to main content

Login

Service: Login

  1. Base URL:
    https://api.seirpk.com/auth/login

  1. Description
    The REST Login service is used to generate tokens for Authenticating REST services. See Rest Authentication.

  1. Request Format

Requests must be sent using HTTP POST method.


  1. Request Headers

Following headers are required:

  • API_KEY: The static API key for SEIR
  • device_id: The device id of the user's device

  1. Request Body

Following parameters are required in the request body:

  • urname: Username
  • urpwd: Hashed user password
  • device_model (optional): Human readable device model

  1. Response Format
  • Content-Type: application/json
  • Success Response: A 200 OK HTTP status code with the appropriate JSON response body.
  • Failure Response: A HTTP status code indicating the fault.
  • Server Error Response: A 500 Internal Server Error HTTP status code when a server-side error occurs.

  1. Response Body Example
{
"user": {
"organizationId": 1,
"deviceType": ZEBRA_PHONE,
"vaccinationCenterId": 4686,
"roleId": 21,
"mappedId": 39623,
"programId": 3,
"username": "tehreem",
"token": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZWhyZWVtIiwiaXNzIjoiWk0vRElHSVRBTC9JUkQiLCJtYXBwZWRfaWQiOjM5NjIzLCJ0b2tlbl90eXBlIjowLCJleHAiOjE3Nzg4NDM0NTEsImlhdCI6MTc3ODc1NzA1MX0.GG1KHzARXUu4jjuppOM1iYrnSU1dOyGVuj2qTSCjTCo",
"refreshToken": "eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJ0ZWhyZWVtIiwiaXNzIjoiWk0vRElHSVRBTC9JUkQiLCJtYXBwZWRfaWQiOjM5NjIzLCJ0b2tlbl90eXBlIjoxLCJleHAiOjE3ODEzNDkwNTEsImlhdCI6MTc3ODc1NzA1MX0.3SIFA6Q8bUTYPS5E-QtvHtemPmhkwabPVCER-_6IHeE"
},
"status": 1
}

See Rest Authentication.